package src;

public class SynchronizedCounter
{
    private int c = 0;

    private synchronized void increment()
    {
        c++;
    }

    public synchronized void decrement()
    {
        c--;
    }

    private synchronized int value()
    {
        return c;
    }

    public synchronized int incrementAndGet()
    {
        increment();
        return value();
    }

}